<?xml version="1.0" encoding="UTF-8" standalone="no"?><HBRRepo><variables/><rulesets/><rules/><components><component id="1" name="OFS_Calculated_Formula" product="Planning" type="script"><property name="application">HP4</property><property name="plantype">OEP_FS</property><property name="display_label">OFS_Calculated_Formula</property><property name="seeded">true</property><script type="calcscript"><![CDATA[if(@ismbr("OEP_Forecast"))
	if((@ismbr(&OEP_FCSTStartYr) and @ismbr(&OEP_FcstMnth:&OEP_EndMnth)) or (@ismbr(@RSIBLINGS (&OEP_CurYr)) and @ismbr(@relative("YearTotal",0))))

		If("OFS_Trend"->"BegBalance"==1)
			if(@isuda("Account","CalcRound"))
				"OFS_Calculated" = @Round(@AVGRANGE(SKIPNONE , "OEP_Actual"->"OFS_Load"->&OEP_CurYr , &OEP_StartMnth:&OEP_CurMnth)*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
			else
				"OFS_Calculated" =@AVGRANGE(SKIPNONE , "OEP_Actual"->"OFS_Load"->&OEP_CurYr , &OEP_StartMnth:&OEP_CurMnth)*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
			endif
		elseif("OFS_Trend"->"BegBalance"==2)
			if(@isuda("Account","CalcRound"))
				"OFS_Calculated" =@Round(("OEP_Actual"->&OEP_CurMnth->&OEP_CurYr->"OFS_Load")*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
			else
				"OFS_Calculated" = ("OEP_Actual"->&OEP_CurMnth->&OEP_CurYr->"OFS_Load")*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
			endif
		elseif("OFS_Trend"->"BegBalance"==3)
			if(@sumrange("OEP_Plan"->"OFS_Total Plan",&OEP_StartMnth:&OEP_EndMnth)-@sumrange("OEP_Actual"->"OFS_Load",&OEP_StartMnth:&OEP_CurMnth)>0)
				if(@ISACCTYPE(LAST))
					if(@isuda("Account","Calcround"))
						"OFS_Calculated"=@round("OEP_Plan"->"OFS_Total Plan");
					else
						"OFS_Calculated" ="OEP_Plan"->"OFS_Total Plan";
					endif
				else
					if(@isuda("Account","Calcround"))
						"OFS_Calculated"=@round(((@sumrange("OEP_Plan"->"OFS_Total Plan",&OEP_StartMnth:&OEP_EndMnth))-(@sumrange("OEP_Actual"->"OFS_Load",&OEP_StartMnth:&OEP_CurMnth)))/@count(skipnone,&OEP_FcstMnth:&OEP_EndMnth));
					else
						"OFS_Calculated"=((@sumrange("OEP_Plan"->"OFS_Total Plan",&OEP_StartMnth:&OEP_EndMnth))-(@sumrange("OEP_Actual"->"OFS_Load",&OEP_StartMnth:&OEP_CurMnth)))/@count(skipnone,&OEP_FcstMnth:&OEP_EndMnth);
					endif
				endif
			else
				"OFS_Calculated"=#missing;
			endif	
		elseif("OFS_Trend"->"BegBalance"==4)
			if(@isuda("Account","CalcRound"))
				"OFS_Calculated" = @Round(@avgrange(skipnone,"OEP_Actual"->"OFS_Load"->&OEP_PriorYr,@relative("YearTotal",0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
			else
				"OFS_Calculated" = @avgrange(skipnone,"OEP_Actual"->"OFS_Load"->&OEP_PriorYr,@relative("YearTotal",0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
			endif
		elseif("OFS_Trend"->"BegBalance"==5)
			if(@isuda("Account","CalcRound"))
				"OFS_Calculated" = @Round(("OEP_Actual"->"OFS_Load"->&OEP_PriorYr)*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
			else
				"OFS_Calculated" = ("OEP_Actual"->"OFS_Load"->&OEP_PriorYr)*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
			endif
		elseif("OFS_Trend"->BegBalance==12)
			"OFS_Calculated" =#missing;
		elseif("OFS_Trend"->BegBalance==#missing and "OFS_Adjustment (+/-)"<>#missing)
			"OFS_Calculated"=0;
			"OFS_Calculated"=#missing;
		endif
	
    elseif(@ismbr(&OEP_QrtlyFcstStart:&OEP_QrtlyFcstEnd))
		if(@ismbr(@relative("OEP_Qrtly Plan",0)))
			if("OFS_Trend"->"BegBalance"==10)
				if(@prior("OEP_Qrtly Plan",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						@Round(@Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						@Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				else
					if(@isuda("Account","CalcRound"))
						if(@ismbr("Qtrly 1"))
							@Round(@Prior("OFS_Total Plan"->"Q1",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						elseif(@ismbr("Qtrly 2"))
							@Round(@Prior("OFS_Total Plan"->"Q2",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						elseif(@ismbr("Qtrly 3"))
							@Round(@Prior("OFS_Total Plan"->"Q3",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						elseif(@ismbr("Qtrly 4"))
							@Round(@Prior("OFS_Total Plan"->"Q4",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						endif
					else
						if(@ismbr("Qtrly 1"))
							@Prior("OFS_Total Plan"->"Q1",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						elseif(@ismbr("Qtrly 2"))
							@Prior("OFS_Total Plan"->"Q2",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						elseif(@ismbr("Qtrly 3"))
							@Prior("OFS_Total Plan"->"Q3",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						elseif(@ismbr("Qtrly 4"))
							@Prior("OFS_Total Plan"->"Q4",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						endif
	endif

				endif
			elseif("OFS_Trend"->BegBalance==12)
				"OFS_Calculated"=#missing;
			elseif("OFS_Trend"->BegBalance==#missing and "OFS_Adjustment (+/-)"<>#missing)
				"OFS_Calculated"=0;
				"OFS_Calculated"=#missing;
			endif
		endif
	elseif(@ismbr(&OEP_YrlyFcstStart:&OEP_YrlyFcstEnd))
		if(@ismbr("Yearly Plan"))
			if("OFS_Trend"->"BegBalance"==10)
				if(@prior("OEP_Yearly Plan",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						@Round(@Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						@Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				elseif(@prior("OEP_Qrtly Plan",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						@Round(@Prior("OFS_Total Plan"->"Qrtly Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						@Prior("OFS_Total Plan"->"Qrtly Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				elseif(@prior("YearTotal",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						@Round(@Prior("OFS_Total Plan"->"YearTotal",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						@Prior("OFS_Total Plan"->"YearTotal",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				endif
			endif
		elseif("OFS_Trend"->BegBalance==12)
			"OFS_Calculated"=#missing;
		elseif("OFS_Trend"->BegBalance==#missing and "OFS_Adjustment (+/-)"<>#missing)
			"OFS_Calculated"=0;
			"OFS_Calculated"=#missing;
		endif
	endif
 elseif(@ismbr("OEP_Plan"))
	if(@ismbr(&OEP_PlanStartYr:&OEP_PlanEndYr))
		if(@ismbr(@relative("YearTotal",0)))

			If("OFS_Trend"->"BegBalance"==1)
				if(@isuda("Account","CalcRound"))
					"OFS_Calculated" =  @Round(@AVGRANGE(SKIPNONE , "OEP_Actual"->"OFS_Load"->&OEP_CurYr , &OEP_StartMnth:&OEP_CurMnth)*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
				else
					"OFS_Calculated" = @AVGRANGE(SKIPNONE , "OEP_Actual"->"OFS_Load"->&OEP_CurYr , &OEP_StartMnth:&OEP_CurMnth)*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
				endif
			elseif("OFS_Trend"->"BegBalance"==2)
				if(@isuda("Account","CalcRound"))
					"OFS_Calculated" = @Round(("OEP_Actual"->&OEP_CurMnth->&OEP_CurYr->"OFS_Load")*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
				else
					"OFS_Calculated" = ("OEP_Actual"->&OEP_CurMnth->&OEP_CurYr->"OFS_Load")*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
				endif
			elseif("OFS_Trend"->"BegBalance"==4)
				if(@isuda("Account","CalcRound"))
					"OFS_Calculated" = @Round(@avgrange(skipnone,"OEP_Actual"->"OFS_Load"->&OEP_PriorYr,@relative("YearTotal",0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
				else
					"OFS_Calculated" = @avgrange(skipnone,"OEP_Actual"->"OFS_Load"->&OEP_PriorYr,@relative("YearTotal",0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
				endif
			elseif("OFS_Trend"->"BegBalance"==5)
				if(@isuda("Account","CalcRound"))
					"OFS_Calculated" = @Round(("OEP_Actual"->"OFS_Load"->&OEP_PriorYr)*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
				else
					"OFS_Calculated" = ("OEP_Actual"->"OFS_Load"->&OEP_PriorYr)*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
				endif
			elseif("OFS_Trend"->"BegBalance"==6)
				if(@isuda("Account","CalcRound"))
					"OFS_Calculated" = @Round(@avgrange(skipnone,"OEP_Forecast"->&OEP_CurYr->"OFS_Total Plan",@relative("YearTotal",0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
				else
					"OFS_Calculated" = @avgrange(skipnone,"OEP_Forecast"->&OEP_CurYr->"OFS_Total Plan",@relative("YearTotal",0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
				endif
			elseif("OFS_Trend"->"BegBalance"==8)
				if(@isuda("Account","CalcRound"))
					"OFS_Calculated" = @Round(@prior("OEP_Forecast"->"OFS_Total Plan",1, @LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
				else
					"OFS_Calculated" = @prior("OEP_Forecast"->"OFS_Total Plan",1, @LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
				endif
			elseif("OFS_Trend"->"BegBalance"==10)
				if(@isuda("Account","calcRound"))
					"OFS_Calculated" = @Round(@prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
				else
					"OFS_Calculated" = @prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
				endif
			elseif("OFS_Trend"->BegBalance==12)
				"OFS_Calculated" = #missing;
			elseif("OFS_Trend"->BegBalance==#missing and "OFS_Adjustment (+/-)"<>#missing)
				"OFS_Calculated"=0;
				"OFS_Calculated"=#missing;
			endif
		endif

	elseif(@ismbr(&OEP_QrtlyPlanStart:&OEP_QrtlyPlanEnd))
		if(@ismbr(@relative("OEP_Qrtly Plan",0)))
			if("OFS_Trend"->"BegBalance"==10)
				if(@prior("OEP_Qrtly Plan",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						"OFS_Calculated" =  @Round(@Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						"OFS_Calculated" =   @Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				else
					if(@isuda("Account","CalcRound"))
						if(@ismbr("Qtrly 1"))
							"OFS_Calculated" = @Round(@Prior("OFS_Total Plan"->"Q1",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						elseif(@ismbr("Qtrly 2"))
							"OFS_Calculated" =  @Round(@Prior("OFS_Total Plan"->"Q2",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						elseif(@ismbr("Qtrly 3"))
							"OFS_Calculated" =  @Round(@Prior("OFS_Total Plan"->"Q3",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						elseif(@ismbr("Qtrly 4"))
							"OFS_Calculated" =  @Round(@Prior("OFS_Total Plan"->"Q4",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
						endif
					else
						if(@ismbr("Qtrly 1"))
							"OFS_Calculated" = @Prior("OFS_Total Plan"->"Q1",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						elseif(@ismbr("Qtrly 2"))
							"OFS_Calculated" =  @Prior("OFS_Total Plan"->"Q2",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						elseif(@ismbr("Qtrly 3"))
							"OFS_Calculated" =  @Prior("OFS_Total Plan"->"Q3",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						elseif(@ismbr("Qtrly 4"))
							"OFS_Calculated" =  @Prior("OFS_Total Plan"->"Q4",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
						endif
					endif
				endif
			elseif("OFS_Trend"->BegBalance==12)
				"OFS_Calculated" = #missing;
			elseif("OFS_Trend"->BegBalance==#missing and "OFS_Adjustment (+/-)"<>#missing)
				"OFS_Calculated"=0;
				"OFS_Calculated"=#missing;
			endif
		endif
	elseif(@ismbr(&OEP_YrlyPlanStart:&OEP_YrlyPlanEnd))
		if(@ismbr("OEP_Yearly Plan"))
			if("OFS_Trend"->"BegBalance"==10)

				if(@prior("OEP_Yearly Plan",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						"OFS_Calculated" = @Round(@Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						"OFS_Calculated" = @Prior("OFS_Total Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				elseif(@prior("OEP_Qrtly Plan",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						"OFS_Calculated" = @Round(@Prior("OFS_Total Plan"->"OEP_Qrtly Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						"OFS_Calculated" = @Prior("OFS_Total Plan"->"OEP_Qrtly Plan",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				elseif(@prior("YearTotal",1,@levmbrs("Years",0))<>#Missing)
					if(@isuda("Account","CalcRound"))
						"OFS_Calculated" = @Round(@Prior("OFS_Total Plan"->"YearTotal",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance"));
					else
						"OFS_Calculated" =  @Prior("OFS_Total Plan"->"YearTotal",1,@LEVMBRS ("Years", 0))*(1+"OFS_% Increase/(Decrease)"->"BegBalance");
					endif
				endif

			endif
		elseif("OFS_Trend"->BegBalance==12)
			"OFS_Calculated" = #missing;
		elseif("OFS_Trend"->BegBalance==#missing and "OFS_Adjustment (+/-)"<>#missing)
			"OFS_Calculated"=0;
			"OFS_Calculated"=#missing;
		endif
	endif
 endif
 ]]></script></component></components></HBRRepo>